package com.itheima.zxy;

import javax.swing.*;
import java.awt.*;

public class demo03 {
    public static void main(String[] args) {
        JFrame jf = new JFrame();
        jf.setSize(400, 300);
        jf.setLocationRelativeTo(null);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.setLayout(new BorderLayout());
        JPanel jpNorth = new JPanel();
        JPanel jpWest = new JPanel();
        JPanel jpCenter = new JPanel();

        jpNorth.setLayout(new FlowLayout());
        jpNorth.setBackground(Color.PINK);
        for (int i = 0; i < 10; i++) {
            jpNorth.add(new JButton("btn" + i));
        }

        jpCenter.setLayout(new FlowLayout());
        jpCenter.setBackground(Color.green);
        for (int j = 0; j < 5; j++) {
            jpCenter.add(new JButton("btn" + j));
        }

        jpWest.setLayout(new FlowLayout());
        jpWest.setBackground(Color.blue);
        for (int k = 0; k < 5; k++) {
            jpWest.add(new JButton("btn" + k));
        }

        jf.add(jpCenter, BorderLayout.CENTER);
        jf.add(jpNorth, BorderLayout.NORTH);
        jf.add(jpWest, BorderLayout.WEST);

        jf.setVisible(true);
    }
}
